package com.ghca.myinfo.common;

import com.alibaba.fastjson.JSONObject;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/2/4.
 */
public class EasuUIPageRequest<T>  {

    private long total;

    private List<T> rows = new ArrayList<>();

    public EasuUIPageRequest(long total, List<T> rows) {
        setTotal(total);
        setRows(rows);
    }

    public EasuUIPageRequest(Page<T> page) {
        this(page.getTotalElements(), page.getContent());
    }



    public long getTotal() {
        return total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public void setTotal(long total) {
        this.total = total;
    }
}
